package com.xuecheng.basic.controller;

import com.xuecheng.commons.model.vo.ResponseResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xuecheng.basic.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 * 课程分类前端控制器
 * </p>
 *
 * @author itheima
 */
@Slf4j
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    private CategoryService  categoryService;
    /**
     * 获取分类信息
     * 请求地址 GET /tree-nodes
     * 响应数据
     */
    @GetMapping("/tree-nodes")
    public ResponseResult findTreeNodes(){
        return categoryService.findTreeNodes();
    }
}
